package page.Beans;

import java.sql.SQLException;


public class mediatorBean {
	private buscarRecBean buscarRec;
	private reservarRecBean reservRec;
	private loginBean login;
	private userBean user;
	private reportarRecBean reporte;
	private cancelarResBean cancelamento;
	private userHistBean historico;
	private inserirRecurso inserirRec;
	private removeRec removerRec;
	private atribuirPen penalidade;
	private insertRecType inserirRecType;
	private insertUser insertUsr;
	private userHist userHist;
	private removeUser remusr;
	private recHist rechist;
	private recDevolution recDevol;
	private putInmaintence putmanut;
	private removeManut remman;
	

	public mediatorBean() throws SQLException{
		buscarRec = new buscarRecBean();
		login = new loginBean();
		user = new userBean();
		reservRec = new reservarRecBean();
		reporte = new reportarRecBean();
		cancelamento = new cancelarResBean();
		setInserirRec(new inserirRecurso());
		removerRec = new removeRec();
		setPenalidade(new atribuirPen());
		inserirRecType = new insertRecType();
		setInsertUsr(new insertUser());
		setUserHist(new userHist());
		setRemusr(new removeUser());
		setRecDevol(new recDevolution());
		setPutmanut(new putInmaintence());
		setRemman(new removeManut());
	}
	
	public removeRec getRemoverRec() {
		return removerRec;
	}

	public void setRemoverRec(removeRec removerRec) {
		this.removerRec = removerRec;
	}

	public buscarRecBean getBuscarRec() {
		return buscarRec;
	}
	public void setBuscarRec(buscarRecBean buscarRec) {
		this.buscarRec = buscarRec;
	}
	public loginBean getLogin() {
		return login;
	}
	public void setLogin(loginBean login) {
		this.login = login;
	}
	public userBean getUser() {
		return user;
	}
	public void setUser(userBean user) {
		this.user = user;
	}
	
	public String buscarRecM() throws SQLException{
		buscarRec.buscarRec(login);
		return "";
	}

	public void setReservRec(reservarRecBean reservRec) {
		this.reservRec = reservRec;
	}

	public reservarRecBean getReservRec() {
		return reservRec;
	}
	
	public String resRec() throws SQLException{
		return reservRec.resRec(login);
	}
	
	public String repRec() throws SQLException{
		return reporte.repRec(login);
	}

	public void setReporte(reportarRecBean reporte) {
		this.reporte = reporte;
	}

	public reportarRecBean getReporte() {
		return reporte;
	}
	
	public String cancelRes() throws SQLException{
		return cancelamento.cancelRes(login);
	}

	public cancelarResBean getCancelamento() {
		return cancelamento;
	}

	public void setCancelamento(cancelarResBean cancelamento) {
		this.cancelamento = cancelamento;
	}
	
	public String logar() throws SQLException{
		String result = login.logar();
		return result;
	}

	public userHistBean getHistorico() {
		return historico;
	}

	public void setHistorico(userHistBean historico) {
		this.historico = historico;
	}
	
	public String hist() throws SQLException{
		historico = new userHistBean(login);
		return user.hist();
	}

	public void setInserirRec(inserirRecurso inserirRec) {
		this.inserirRec = inserirRec;
	}

	public inserirRecurso getInserirRec() {
		return inserirRec;
	}
	
	public String insertRec(){
		return inserirRec.inserirRec(login);
	}
	
	public String remRec() throws SQLException{
		return removerRec.remRec(login);
	}

	public void setPenalidade(atribuirPen penalidade) {
		this.penalidade = penalidade;
	}

	public atribuirPen getPenalidade() {
		return penalidade;
	}
	
	public String atribPen() throws SQLException{
		return penalidade.atribPen(login);
	}

	public void setInserirRecType(insertRecType inserirRecType) {
		this.inserirRecType = inserirRecType;
	}

	public insertRecType getInserirRecType() {
		return inserirRecType;
	}
	
	public String insertRecType(){
		return inserirRecType.insertRecType_(login);
	}

	public void setInsertUsr(insertUser insertUsr) {
		this.insertUsr = insertUsr;
	}

	public insertUser getInsertUsr() {
		return insertUsr;
	}
	
	public String insertUser(){
		return insertUsr.insertUsr(login);
	}

	public void setUserHist(userHist userHist) {
		this.userHist = userHist;
	}

	public userHist getUserHist() {
		return userHist;
	}
	
	public String userHistadm(){
		return userHist.userHistadm(login);
	}

	public void setRemusr(removeUser remusr) {
		this.remusr = remusr;
	}

	public removeUser getRemusr() {
		return remusr;
	}
	
	public String remUser() throws SQLException{
		return remusr.remUser(login);
	}

	public void setRecDevol(recDevolution recDevol) {
		this.recDevol = recDevol;
	}

	public recDevolution getRecDevol() {
		return recDevol;
	}

	public void setRechist(recHist rechist) {
		this.rechist = rechist;
	}

	public recHist getRechist() {
		return rechist;
	}
	
	public String recDevolu() throws SQLException{
		return recDevol.recDevol(login);
	}
	
	public String rechistc() throws SQLException{
		this.rechist = new recHist(login);
		return user.histRec();
	}

	public void setPutmanut(putInmaintence putmanut) {
		this.putmanut = putmanut;
	}

	public putInmaintence getPutmanut() {
		return putmanut;
	}
	
	public String putInMaint() throws SQLException{
		return putmanut.putInMain(login);
	}

	public void setRemman(removeManut remman) {
		this.remman = remman;
	}

	public removeManut getRemman() {
		return remman;
	}
	
	public String remManut() throws SQLException{
		return remman.remManut(login);
	}
	
	
}
